// 引入依赖项
const proxy = require('http-proxy-middleware')
const autoprefixer = require('autoprefixer')
const pxtorem = require('postcss-pxtorem')
module.exports = {
    devServer: {
        open: true,
        // 配置代理
        host: '0.0.0.0',
        port: 8081,
        proxy: {
            '/api': {
                target: 'http://localhost:4000', //请求数据的代理地址，这里设置的地址会代替axios中设置的baseURL
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    },
    css: {
        loaderOptions: {
            postcss: {
                plugins: [
                    autoprefixer(),
                    pxtorem({
                        rootValue: 37.5,
                        propList: ['*'],
                        selectorBlackList: ['van-circle__layer']
                    })
                ]
            }
        }
    },
    publicPath: process.env.NODE_ENV === 'production' ? './' : '/'
}